//
//  UILabel+Extension.swift
//  sinaWeibo
//
//  Created by 浅爱 on 16/3/18.
//  Copyright © 2016年 y. All rights reserved.
//

import UIKit



extension UILabel {

    
    // 类工厂 [UIButton buttonWithType: xxxx]
    // 类方法
    class func labelWith(text: String, textColor: UIColor, fontOfSize: CGFloat) -> UILabel {
    
        let lb = UILabel()
        
        lb.text = text
        
        lb.textColor = textColor
        
        lb.font = UIFont.systemFontOfSize(fontOfSize)
        
        // frame
        lb.sizeToFit()
        
        // 自动换行
        lb.numberOfLines = 0
        
        // 设置居中
        lb.textAlignment = .Center

        
        return lb
    
    }

}






